
package org.openhds.domain.model;

import java.io.Serializable;
import java.util.Calendar;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Past;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.openhds.domain.annotations.Description;
import org.openhds.domain.constraint.CheckEntityNotVoided;
import org.openhds.domain.constraint.CheckIndividualNotUnknown;
import org.openhds.domain.constraint.Searchable;


/**
 * Generated by JCodeModel
 * 
 */
@Description(description = "Standard Verbal Autopsy Questionnaire for adolescent and adult deaths. (12 years and over)")
@Entity
@Table(name = "adultvpm")
@XmlRootElement(name = "adultvpm")
public class AdultVPM
    extends AuditableCollectedEntity
    implements Serializable
{

    public final static long serialVersionUID = -4307963520301090920L;
    @Searchable
    @CheckEntityNotVoided
    @CheckIndividualNotUnknown
    @ManyToOne(cascade = {
        CascadeType.ALL
    })
    @Description(description = "Individual who deceased, identified by the external id.")
    private Individual individual;
    @Searchable
    @ManyToOne
    @Description(description = "Visit that is associated with the verbal autopsy, identified by the external id.")
    private Visit visit;
    @Past
    @Temporal(TemporalType.DATE)
    @Description(description = "Date of interview for the verbal autopsy.")
    private Calendar recordedDate;

    public Individual getIndividual() {
        return individual;
    }

    public void setIndividual(Individual indiv) {
        individual = indiv;
    }

    public Visit getVisit() {
        return visit;
    }

    public void setVisit(Visit vis) {
        visit = vis;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getRecordedDate() {
        return recordedDate;
    }

    public void setRecordedDate(Calendar date) {
        recordedDate = date;
    }

}
